<template>
  <el-table
    :data="arr"
    border
    style="width: 100%"
    :default-sort="{ prop: 'date', order: 'descending' }"
  >
    <el-table-column
      prop="username"
      label="登录账号"
      width="180"
    ></el-table-column>
    <el-table-column
      prop="lastLogin.ip"
      label="上次登入IP"
      width="180"
    ></el-table-column>
    <el-table-column
      prop="lastLogin.loginTime"
      label="上次登入时间"
      sortable
    ></el-table-column>
    <el-table-column prop="nowLogin.ip" label="本次登入IP"></el-table-column>
    <el-table-column
      prop="nowLogin.loginTime"
      label="本次登入时间"
    ></el-table-column>
  </el-table>
</template>

<script>
import { getConLogInquire } from "../../api/welcome";
import storage from "../../utils/storage";
export default {
  meta: {
    title: "glsy",
  },
  data() {
    return {
      arr: [],
    };
  },
  mounted() {
    this.ConLogFn();
  },
  methods: {
    formatter(row, column) {
      return row.address;
    },
    async ConLogFn() {
      let res = await getConLogInquire();
      this.arr = res.data.data;
    },
  },
};
</script>

<style lang="less" scoped>
/deep/ .cell {
  text-align: center;
}
</style>
